﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using SCGITest;
using SCGILite;
using SCGILite.Helper;
using SCGILite.NetLib;

namespace SCGITest.PageTemplate
{
    class AsyncPage : TemplatePage, ITemplatePage
    {
        DateTime sj = DateTime.Now;
        public AsyncPage(DemoSCGISession ses)
        {
            se = ses;
            Title = "Asynchronous Page";
        }
        public bool AsyncEnd
        {
            get 
            {
                TimeSpan span = DateTime.Now - sj;
                double d = span.TotalSeconds;
                return (d > 5) || (d < 0);
            }
        }
        protected override void ctorControl()
        {
            Label lable = new Label();
            this.Controls.Add(lable);
            lable.Text = "Async Request Page: __" + sj.ToLongTimeString() + "__" + DateTime.Now.ToLongTimeString();
        }
    }
}
